import { defineStore } from 'pinia'
import { getProductList } from '@/api/repayScheme'

const useRepaySchemeStore = defineStore('repayScheme', {
  state: () => ({
    productList: [],
    repaySchemeList: []
  }),
  actions: {
    async getProductList() {
      if (this.productList.length) return
      getProductList().then(res => {
        this.productList = res.product_list
      }).catch(err => {
        console.log(err)
      })
    }
  }
})

export default useRepaySchemeStore
